﻿using DocumentFormat.OpenXml.Lite.Helper;
using DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.SpreadsheetML.Excel.Table
{
    [XmlRoot("sortCondition", Namespace = Constants.ExcelMain)]
    public class SortCondition : XmlSerializable
    {
        [XmlAttribute("ref", Form = XmlSchemaForm.Qualified)]
        public string Reference { get; set; }

        [Optional]
        [XmlAttribute("descending", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> Descending { get; set; }

        [Optional]
        [XmlAttribute("sortBy", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_SortBy> SortBy { get; set; }

        [Optional]
        [XmlAttribute("customList", Form = XmlSchemaForm.Qualified)]
        public string CustomList { get; set; }

        [Optional]
        [XmlAttribute("dxfId", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> FormatId { get; set; }

        [Optional]
        [XmlAttribute("iconSet", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_IconSetType> IconSetType { get; set; }

        [Optional]
        [XmlAttribute("iconId", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> IconId { get; set; }

        public SortCondition() { }
    }
}
